import request from '@/utils/request'

export const listSportsLibrary = (search) =>
    request({
        url: '/sportsItemLibrary',
        method: 'get',
        params: {
            code: search.code,
            offset: search.offset,
            limit: search.limit
        }
    })

export const getSportsLibraryById = (id) =>
    request({
        url: '/sportsItemLibrary/' + id,
        method: 'get'
    })

export const updateSportsLibrary = (sportsItem) =>
    request({
        url: '/sportsItemLibrary',
        method: 'put',
        data: sportsItem
    })

export const saveSportsLibrary = (sportsItem) =>
    request({
        url: '/sportsItemLibrary',
        method: 'post',
        data: sportsItem
    })